<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-model与checkbox</title>
</head>
<body>
    <div id="app">
        <!-- 实现用户的协议选择功能 -->
        <label for="agree">
            <input id="agree" type="checkbox" v-model="isAgree">同意协议
        </label>
        <h3>您选择的是:{{isAgree}}</h3>
        <button :disabled="!isAgree">下一步</button>
        
        <hr>

        <!-- 实现多选 -->
        <label for="ymq">
            <input type="checkbox" id="ymq" v-model="hobbies" value="羽毛球">羽毛球
        </label>
        <label for="zq">
            <input type="checkbox" id="zq" v-model="hobbies" value="足球">足球
        </label>
        <label for="lq">
            <input type="checkbox" id="lq" v-model="hobbies" value="篮球">篮球
        </label>
        <label for="ppq">
            <input type="checkbox" id="ppq" v-model="hobbies" value="乒乓球">乒乓球
        </label>
        <h3>您的爱好是:{{hobbies}}</h3>
    </div>
    <script src="../vue/vue.js"></script>
    <script>
        const app = new Vue({
            el:"#app",
            data:{
                isAgree:false,
                hobbies:[]
            },
            methods: {
                
            },
        });
    </script>
</body>
</html>